package com.bwie.controller;

import com.bwie.pojo.po.Apply;
import com.bwie.pojo.po.OrderPark;
import com.bwie.service.ApplyService;
import com.bwie.service.OrderParkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/sys")
public class SysController {


    @Autowired
    private OrderParkService orderParkService;
    @Autowired
    private ApplyService applyService;
    //去登录
    @RequestMapping("toLogin")
    public String toLogin(){
        return "login/list";
    }

    //去菜单
    @RequestMapping("toSys")
    public String toSys(){
        return "sys/main";
    }

    //去充值列表
    @RequestMapping("toRechargeList")
    public String toRechargeList(){
        return "recharge/list";
    }
    //去充值页面
    @RequestMapping("toRechargeAdd")
    public String toRechargeAdd(){
        return "recharge/add";
    }

    //去充值审核页面
    @RequestMapping("toRechargeShenhe")
    public String toRechargeShenhe(){
        return "recharge/shenhe";
    }
    //去预约列表
    @RequestMapping("toOrderParkList")
    public String toOrderParkList(){
        return "/orderPark/list";
    }

    //去新增预约列表
    @RequestMapping("toOrderParkAdd")
    public String toOrderParkAdd(){
        return "/orderPark/add";
    }
    //去收费标准页面
    @RequestMapping("toChargingList")
    public String toChargingList(){
        return "/charging/list";
    }
    //去收费标准新增页面
    @RequestMapping("toChargingAdd")
    public String toChargingAdd(){
        return "/charging/add";
    }

    //去月卡列表
    @RequestMapping("toMonthList")
    public String toMonthList(){
        return "/month/list";
    }

    //去办理月卡
    @RequestMapping("toMonthAdd")
    public String toMonthAdd(){
        return "/month/add";
    }
    //去我的订单页面
    @RequestMapping("toMyMonthList")
    public String toMyMonthList(){
        return "/myMonth/list";
    }
    //去申请退款
    @RequestMapping("toOrderParkBack")
    public String toOrderParkBack(Integer orderParkId, Model model){
        OrderPark orderPark = orderParkService.getOrderParkById(orderParkId);
        model.addAttribute("orderPark",orderPark);
        return "/orderPark/back";
    }
    //去审核列表
    @RequestMapping("toApplyList")
    public String toApplyList(){
        return "/apply/list";
    }

    //去审核页面
    @RequestMapping("toApplyShen")
    public String toApplyShen(Integer applyId,Model model){
        Apply apply = applyService.getApplyById(applyId);
        model.addAttribute("apply",apply);
        return "/apply/shen";
    }

}
